import request from "@/plugins/request";
let pre = "";
if (process.env.NODE_ENV !== "development") {
  pre = "/api/ps/mess-center";
}

// 分页查询我的站内信
export function queryMyMails(data) {
  return request({
    url: `${pre}/messMail/queryMyMails`,
    method: "post",
    data,
  });
}

// 设置单条站内信已读
export function setMailRead(mailId) {
  return request({
    url: `${pre}/messMail/setMailRead?mailId=${mailId}`,
    method: "get",
  });
}

// 查询站内信基本信息详情
export function queryMailDetail(mailId) {
  return request({
    url: `${pre}/messMail/queryMailDetail?mailId=${mailId}`,
    method: "get",
  });
}

// 一键设置所有未读站内信已读
export function setMailReadByOneKey() {
  return request({
    url: `${pre}/messMail/setMailReadByOneKey`,
    method: "get",
  });
}

// 查询我的未读消息数量
export function queryMyUnReadMessNum() {
  return request({
    url: `${pre}/messCommon/queryMyUnReadMessNum`,
    method: "get",
  });
}
